import logging
import unittest
from htmltestreport import HTMLTestReport

from common.logging_user import GetLogger
from config import BASE_DIR
from scprits.test_ihrm_login import TestIhrmLogin

# 作为整个项目的入口，初始化日志
GetLogger().get_logger(BASE_DIR + "/log/ihrm.log")

# 创建测试套件
suite = unittest.TestSuite()
logging.info("创建测试套件成功")


# 添加测试类
suite.addTest(unittest.makeSuite(TestIhrmLogin))
# suite.addTest(unittest.makeSuite( TestIhrmEmpAdd))

# 创建html类实例，runner
runner = HTMLTestReport(BASE_DIR + "./report/ihrm_login.html", description="ihrm登录模块测试", title="登录模块")
runner.run(suite)
logging.info("成功生成测试报告")

